package com.yunfei.bo;


import com.yunfei.entity.TPersonalUserEntity;
import com.yunfei.utils.string.StringUtil;

import java.util.List;

/**
    * tPersonalUserSystem 实体类
    * Sun Apr 08 11:56:26 CST 2018
	* zhengyunfei
    */ 
public class TPersonalUserBo implements java.io.Serializable{
	private String userId;
	private String userName;
	private String age;
	private String mobile;
	private String password;
	private String sex;
	private String position;
	private String monthlyIncome;
	private String familyMembers;
	private String maritalStatus;
	private String withoutChildren;
	private String industry;
	private String createDate;
	private String inviteCode;
	private String exclusiveInvitationCode;
	private String lastLoginTime;
	private String userType;
	private String updateDate;
	private String field;
	private String order;
	private String budget;//预算
	private String acceptStatus;//声明接受状态 0不接受1已接受
	List<TPersonalUserChildBo> childrens;//子女基本信息
	private int loginCount;//登录次数
	private String source;//来源 0 PC 1 App
	private String iconUrl;//iconUrl

	public String getIconUrl() {
		return iconUrl;
	}

	public void setIconUrl(String iconUrl) {
		this.iconUrl = iconUrl;
	}

	public String getSource() {
		return source;
	}

	public void setSource(String source) {
		this.source = source;
	}
	public String getAcceptStatus() {
		return acceptStatus;
	}

	public void setAcceptStatus(String acceptStatus) {
		this.acceptStatus = acceptStatus;
	}

	public String getBudget() {
		return budget;
	}

	public void setBudget(String budget) {
		this.budget = budget;
	}

	public int getLoginCount() {
	   return loginCount;
   }
    public void setLoginCount(int loginCount) {
	   this.loginCount = loginCount;
   }

	public List<TPersonalUserChildBo> getChildrens() {
		return childrens;
	}

	public void setChildrens(List<TPersonalUserChildBo> childrens) {
		this.childrens = childrens;
	}

	public String getField() {
		   return field;
   }
   public void setField(String field) {
		   this.field = field;
   }
   public String getOrder() {
		   return order;
   }
   public void setOrder(String order) {
		   this.order = order;
   }
	private int curNo;
	public int getCurNo() {
	int value=(curNo-1)*curSize;
	return value;
	}	
	public void setCurNo(int curNo) {
		this.curNo = curNo;
	}
	private int curSize;
	public int getCurSize() {
		return curSize;
	}
	public void setCurSize(int curSize) {
		this.curSize = curSize;
	}
	public void setUserId(String userId){
		this.userId=userId;
	}
	public String getUserId(){
		return userId;
	}
	public void setUserName(String userName){
		this.userName=userName;
	}
	public String getUserName(){
		if(StringUtil.isNullOrEmpty(userName)){
			return "";
		}
		return userName;
	}
	public void setAge(String age){
		this.age=age;
	}
	public String getAge(){
		return age;
	}
	public void setMobile(String mobile){
		this.mobile=mobile;
	}
	public String getMobile(){
		return mobile;
	}
	public void setPassword(String password){
		this.password=password;
	}
	public String getPassword(){
		return password;
	}
	public void setSex(String sex){
		this.sex=sex;
	}
	public String getSex(){
		if(!StringUtil.isNullOrEmpty(sex)){
			/*if("1".equals(sex)){
				return "男";
			}
			if("2".equals(sex)){
				return "女";
			}*/
		}
		return sex;
	}
	public void setPosition(String position){
		this.position=position;
	}
	public String getPosition(){
		return position;
	}
	public void setMonthlyIncome(String monthlyIncome){
		this.monthlyIncome=monthlyIncome;
	}
	public String getMonthlyIncome(){
		return monthlyIncome;
	}
	public void setFamilyMembers(String familyMembers){
		this.familyMembers=familyMembers;
	}
	public String getFamilyMembers(){
		if(StringUtil.isNullOrEmpty(familyMembers)){
			familyMembers="";
		}
		return familyMembers;
	}
	public void setMaritalStatus(String maritalStatus){
		this.maritalStatus=maritalStatus;
	}
	public String getMaritalStatus(){
		return maritalStatus;
	}
	public void setWithoutChildren(String withoutChildren){
		this.withoutChildren=withoutChildren;
	}
	public String getWithoutChildren(){
		if(!StringUtil.isNullOrEmpty(childrens)&&childrens.size()>0){
			withoutChildren=childrens.size()+"";
		}
		return withoutChildren;
	}
	public void setIndustry(String industry){
		this.industry=industry;
	}
	public String getIndustry(){
		return industry;
	}
	public void setCreateDate(String createDate){
		this.createDate=createDate;
	}
	public String getCreateDate(){
		return createDate;
	}
	public void setInviteCode(String inviteCode){
		this.inviteCode=inviteCode;
	}
	public String getInviteCode(){
		return inviteCode;
	}
	public void setExclusiveInvitationCode(String exclusiveInvitationCode){
		this.exclusiveInvitationCode=exclusiveInvitationCode;
	}
	public String getExclusiveInvitationCode(){
		return exclusiveInvitationCode;
	}
	public void setLastLoginTime(String lastLoginTime){
		this.lastLoginTime=lastLoginTime;
	}
	public String getLastLoginTime(){
	if(!StringUtil.isNullOrEmpty(lastLoginTime)){
			lastLoginTime=lastLoginTime.replace(".0","");
		}
		return lastLoginTime;
	}
	public void setUserType(String userType){
		this.userType=userType;
	}
	public String getUserType(){
		return userType;
	}
	public void setUpdateDate(String updateDate){
		this.updateDate=updateDate;
	}
	public String getUpdateDate(){
		return updateDate;
	}
	public static TPersonalUserEntity boToEntity(TPersonalUserBo bo){
		TPersonalUserEntity entity=new TPersonalUserEntity();
		entity.setUserId(bo.getUserId());
		entity.setUserName(bo.getUserName());
		entity.setAge(bo.getAge());
		entity.setMobile(bo.getMobile());
		entity.setPassword(bo.getPassword());
		entity.setSex(bo.getSex());
		entity.setPosition(bo.getPosition());
		entity.setMonthlyIncome(bo.getMonthlyIncome());
		entity.setFamilyMembers(bo.getFamilyMembers());
		entity.setMaritalStatus(bo.getMaritalStatus());
		entity.setWithoutChildren(bo.getWithoutChildren());
		entity.setIndustry(bo.getIndustry());
		entity.setCreateDate(bo.getCreateDate());
		entity.setInviteCode(bo.getInviteCode());
		entity.setExclusiveInvitationCode(bo.getExclusiveInvitationCode());
		entity.setLastLoginTime(bo.getLastLoginTime());
		entity.setUserType(bo.getUserType());
		entity.setUpdateDate(bo.getUpdateDate());
		entity.setBudget(bo.getBudget());
		entity.setAcceptStatus(bo.getAcceptStatus());
		return entity;
	}
	public static TPersonalUserBo entityToBo(TPersonalUserEntity bo){
		TPersonalUserBo entity=new TPersonalUserBo();
		entity.setUserId(bo.getUserId());
		entity.setUserName(bo.getUserName());
		entity.setAge(bo.getAge());
		entity.setMobile(bo.getMobile());
		entity.setPassword(bo.getPassword());
		entity.setSex(bo.getSex());
		entity.setPosition(bo.getPosition());
		entity.setMonthlyIncome(bo.getMonthlyIncome());
		entity.setFamilyMembers(bo.getFamilyMembers());
		entity.setMaritalStatus(bo.getMaritalStatus());
		entity.setWithoutChildren(bo.getWithoutChildren());
		entity.setIndustry(bo.getIndustry());
		entity.setCreateDate(bo.getCreateDate());
		entity.setInviteCode(bo.getInviteCode());
		entity.setExclusiveInvitationCode(bo.getExclusiveInvitationCode());
		entity.setLastLoginTime(bo.getLastLoginTime());
		entity.setUserType(bo.getUserType());
		entity.setUpdateDate(bo.getUpdateDate());
		entity.setBudget(bo.getBudget());
		entity.setAcceptStatus(bo.getAcceptStatus());
		return entity;
	}
	public static String changeFieldColumn(String field){
		String result="";
			if(!StringUtil.isNullOrEmpty(field)){
				if(field.equals("userId")){
					result="USER_ID";
				}
				if(field.equals("userName")){
					result="USER_NAME";
				}
				if(field.equals("age")){
					result="AGE";
				}
				if(field.equals("mobile")){
					result="MOBILE";
				}
				if(field.equals("password")){
					result="PASSWORD";
				}
				if(field.equals("sex")){
					result="SEX";
				}
				if(field.equals("position")){
					result="POSITION";
				}
				if(field.equals("monthlyIncome")){
					result="MONTHLY_INCOME";
				}
				if(field.equals("familyMembers")){
					result="FAMILY_MEMBERS";
				}
				if(field.equals("maritalStatus")){
					result="MARITAL_STATUS";
				}
				if(field.equals("withoutChildren")){
					result="WITHOUT_CHILDREN";
				}
				if(field.equals("industry")){
					result="INDUSTRY";
				}
				if(field.equals("createDate")){
					result="CREATE_DATE";
				}
				if(field.equals("inviteCode")){
					result="INVITE_CODE";
				}
				if(field.equals("exclusiveInvitationCode")){
					result="EXCLUSIVE_INVITATION_CODE";
				}
				if(field.equals("lastLoginTime")){
					result="LAST_LOGIN_TIME";
				}
				if(field.equals("userType")){
					result="USER_TYPE";
				}
				if(field.equals("updateDate")){
					result="UPDATE_DATE";
				}
		}
		return result;
	}
}

